Add a .length property to PopupMenuBase, and use it from the network
menu to destroy the menu when removing a network without rebuilding.
https://bugzilla.gnome.org/show_bug.cgi?id=645981
this.box = new St.BoxLayout({ vertical: true });
}
this.box.connect_after('queue-relayout', Lang.bind(this, this._menuQueueRelayout));
+ this.length = 0;
this.isOpen = false;
menuItem.connect('destroy', Lang.bind(this, function() {
menuItem.disconnect(menuItem._subMenuActivateId);
menuItem.disconnect(menuItem._subMenuActiveChangeId);
+
+ this.length--;
}));
} else if (menuItem instanceof PopupSubMenuMenuItem) {
if (before_item == null)
this._connectItemSignals(menuItem);
else
throw TypeError("Invalid argument to PopupMenuBase.addMenuItem()");
+
+ this.length++;
},
getColumnWidths: function() {
if (apObj.item)
apObj.item.destroy();
this._networks.splice(pos, 1);
+ if (this._overflowItem &&
+ this._overflowItem.menu.length == 0) {
+ this._overflowItem.destroy();
+ this._overflowItem = null;
+ }
} else if (apObj.item)
apObj.item.updateAccessPoints(apObj.accessPoints);
},